const int buttonPin = 27; // the number of the pushbutton pin const int ledPin_1 = 26; // the number of the LED pin const int ledPin_2 = 0; const int ledPin_3 = 1; // variables will change: int buttonState = 0; // variable for reading the pushbutton status void setup() { // initialize the LED pin as an output: pinMode(ledPin_1, OUTPUT); pinMode(ledPin_2, OUTPUT); pinMode(ledPin_3, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); } void loop() { // read the state of the pushbutton value: buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed. If it is, the buttonState is HIGH: if (buttonState == HIGH) { // turn LED on: digitalWrite(ledPin_1, HIGH); digitalWrite(ledPin_2, HIGH); digitalWrite(ledPin_3, HIGH); } else { // turn LED off: digitalWrite(ledPin_1, LOW); digitalWrite(ledPin_2, LOW); digitalWrite(ledPin_3, LOW); } }